package com.mindfactory.pwdbox.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class DatabaseHelper extends SQLiteOpenHelper{

	public DatabaseHelper(Context context, String name, CursorFactory factory, int version) {
		
		super(context, name, factory, version);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		
		db.execSQL("Create table password_table(id integer primary key autoincrement,name varchar(20),password varchar(20),account varchar(20))");
		db.execSQL("Create table login_table(account varchar(20) primary key,password varchar(20),questions varchar(20),answer varchar(20))");
//		db.execSQL("Create table rules_table(id integer primary key autoincrement,name varchar(20))");
		//db.execSQL("Create table rules_on_user_table(account varchar(20) foreign key references login_table(account),rule_id integer foreign key references login_table(account))");
		//db.execSQL("Create table rules_on_user_table(account varchar(20),rule_id integer)");
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		
	}
}
